home *** CD-ROM | disk | FTP | other *** search
- #define EXTERN extern
- #include "texd.h"
-
- void zshipout ( p )
- halfword p ;
- {/* 30 */ shipout_regmem
- integer pageloc ;
- schar j, k ;
- poolpointer s ;
- schar oldsetting ;
- if ( eqtb [ 6197 ] .cint > 0 )
- {
- printnl ( 335 ) ;
- println () ;
- print ( 822 ) ;
- }
- if ( termoffset > maxprintline - 9 )
- println () ;
- else if ( ( termoffset > 0 ) || ( fileoffset > 0 ) )
- printchar ( 32 ) ;
- printchar ( 91 ) ;
- j = 9 ;
- while ( ( eqtb [ 6218 + j ] .cint == 0 ) && ( j > 0 ) ) decr ( j ) ;
- {register integer for_end; k = 0 ; for_end = j ; if ( k <= for_end) do
- {
- printint ( eqtb [ 6218 + k ] .cint ) ;
- if ( k < j )
- printchar ( 46 ) ;
- }
- while ( k++ < for_end ) ; }
- flush ( stdout ) ;
- if ( eqtb [ 6197 ] .cint > 0 )
- {
- printchar ( 93 ) ;
- begindiagnostic () ;
- showbox ( p ) ;
- enddiagnostic ( true ) ;
- }
- if ( ( mem [ p + 3 ] .cint > 1073741823L ) || ( mem [ p + 2 ] .cint >
- 1073741823L ) || ( mem [ p + 3 ] .cint + mem [ p + 2 ] .cint + eqtb [ 6749 ]
- .cint > 1073741823L ) || ( mem [ p + 1 ] .cint + eqtb [ 6748 ] .cint >
- 1073741823L ) )
- {
- {
- if ( interaction == 3 )
- wakeupterminal () ;
- printnl ( 262 ) ;
- print ( 826 ) ;
- }
- {
- helpptr = 2 ;
- helpline [ 1 ] = 827 ;
- helpline [ 0 ] = 828 ;
- }
- error () ;
- if ( eqtb [ 6197 ] .cint <= 0 )
- {
- begindiagnostic () ;
- printnl ( 829 ) ;
- showbox ( p ) ;
- enddiagnostic ( true ) ;
- }
- goto lab30 ;
- }
- if ( mem [ p + 3 ] .cint + mem [ p + 2 ] .cint + eqtb [ 6749 ] .cint > maxv
- )
- maxv = mem [ p + 3 ] .cint + mem [ p + 2 ] .cint + eqtb [ 6749 ] .cint ;
- if ( mem [ p + 1 ] .cint + eqtb [ 6748 ] .cint > maxh )
- maxh = mem [ p + 1 ] .cint + eqtb [ 6748 ] .cint ;
- dvih = 0 ;
- dviv = 0 ;
- curh = eqtb [ 6748 ] .cint ;
- dvif = 0 ;
- if ( outputfilename == 0 )
- {
- if ( jobname == 0 )
- openlogfile () ;
- packjobname ( 787 ) ;
- while ( ! bopenout ( dvifile ) ) promptfilename ( 788 , 787 ) ;
- outputfilename = bmakenamestring ( dvifile ) ;
- }
- if ( totalpages == 0 )
- {
- {
- dvibuf [ dviptr ] = 247 ;
- incr ( dviptr ) ;
- if ( dviptr == dvilimit )
- dviswap () ;
- }
- {
- dvibuf [ dviptr ] = 2 ;
- incr ( dviptr ) ;
- if ( dviptr == dvilimit )
- dviswap () ;
- }
- dvifour ( 25400000L ) ;
- dvifour ( 473628672L ) ;
- preparemag () ;
- dvifour ( eqtb [ 6180 ] .cint ) ;
- oldsetting = selector ;
- selector = 21 ;
- print ( 820 ) ;
- printint ( eqtb [ 6186 ] .cint ) ;
- printchar ( 46 ) ;
- printtwo ( eqtb [ 6185 ] .cint ) ;
- printchar ( 46 ) ;
- printtwo ( eqtb [ 6184 ] .cint ) ;
- printchar ( 58 ) ;
- printtwo ( eqtb [ 6183 ] .cint / 60 ) ;
- printtwo ( eqtb [ 6183 ] .cint % 60 ) ;
- selector = oldsetting ;
- {
- dvibuf [ dviptr ] = ( poolptr - strstart [ strptr ] ) ;
- incr ( dviptr ) ;
- if ( dviptr == dvilimit )
- dviswap () ;
- }
- {register integer for_end; s = strstart [ strptr ] ; for_end = poolptr -
- 1 ; if ( s <= for_end) do
- {
- dvibuf [ dviptr ] = strpool [ s ] ;
- incr ( dviptr ) ;
- if ( dviptr == dvilimit )
- dviswap () ;
- }
- while ( s++ < for_end ) ; }
- poolptr = strstart [ strptr ] ;
- }
- pageloc = dvioffset + dviptr ;
- {
- dvibuf [ dviptr ] = 139 ;
- incr ( dviptr ) ;
- if ( dviptr == dvilimit )
- dviswap () ;
- }
- {register integer for_end; k = 0 ; for_end = 9 ; if ( k <= for_end) do
- dvifour ( eqtb [ 6218 + k ] .cint ) ;
- while ( k++ < for_end ) ; }
- dvifour ( lastbop ) ;
- lastbop = pageloc ;
- curv = mem [ p + 3 ] .cint + eqtb [ 6749 ] .cint ;
- tempptr = p ;
- if ( mem [ p ] .hh.b0 == 1 )
- vlistout () ;
- else hlistout () ;
- {
- dvibuf [ dviptr ] = 140 ;
- incr ( dviptr ) ;
- if ( dviptr == dvilimit )
- dviswap () ;
- }
- incr ( totalpages ) ;
- curs = -1 ;
- lab30: ;
- if ( eqtb [ 6197 ] .cint <= 0 )
- printchar ( 93 ) ;
- deadcycles = 0 ;
- flush ( stdout ) ;
- ;
- #ifdef STAT
- if ( eqtb [ 6194 ] .cint > 1 )
- {
- printnl ( 823 ) ;
- printint ( varused ) ;
- printchar ( 38 ) ;
- printint ( dynused ) ;
- printchar ( 59 ) ;
- }
- #endif /* STAT */
- flushnodelist ( p ) ;
- ;
- #ifdef STAT
- if ( eqtb [ 6194 ] .cint > 1 )
- {
- print ( 824 ) ;
- printint ( varused ) ;
- printchar ( 38 ) ;
- printint ( dynused ) ;
- print ( 825 ) ;
- printint ( himemmin - lomemmax - 1 ) ;
- println () ;
- }
- #endif /* STAT */
- }
- void zscanspec ( c , threecodes )
- groupcode c ;
- boolean threecodes ;
- {/* 40 */ scanspec_regmem
- integer s ;
- schar speccode ;
- if ( threecodes )
- s = savestack [ saveptr + 0 ] .cint ;
- if ( scankeyword ( 835 ) )
- speccode = 0 ;
- else if ( scankeyword ( 836 ) )
- speccode = 1 ;
- else {
-
- speccode = 1 ;
- curval = 0 ;
- goto lab40 ;
- }
- scandimen ( false , false , false ) ;
- lab40: if ( threecodes )
- {
- savestack [ saveptr + 0 ] .cint = s ;
- incr ( saveptr ) ;
- }
- savestack [ saveptr + 0 ] .cint = speccode ;
- savestack [ saveptr + 1 ] .cint = curval ;
- saveptr = saveptr + 2 ;
- newsavelevel ( c ) ;
- scanleftbrace () ;
- }
- halfword zhpack ( p , w , m )
- halfword p ;
- scaled w ;
- smallnumber m ;
- {/* 21 50 10 */ register halfword Result; hpack_regmem
- halfword r ;
- halfword q ;
- scaled h, d, x ;
- scaled s ;
- halfword g ;
- glueord o ;
- internalfontnumber f ;
- fourquarters i ;
- eightbits hd ;
- lastbadness = 0 ;
- r = getnode ( 7 ) ;
- mem [ r ] .hh.b0 = 0 ;
- mem [ r ] .hh.b1 = 0 ;
- mem [ r + 4 ] .cint = 0 ;
- q = r + 5 ;
- mem [ q ] .hh .v.RH = p ;
- h = 0 ;
- d = 0 ;
- x = 0 ;
- totalstretch [ 0 ] = 0 ;
- totalshrink [ 0 ] = 0 ;
- totalstretch [ 1 ] = 0 ;
- totalshrink [ 1 ] = 0 ;
- totalstretch [ 2 ] = 0 ;
- totalshrink [ 2 ] = 0 ;
- totalstretch [ 3 ] = 0 ;
- totalshrink [ 3 ] = 0 ;
- while ( p != 0 ) {
-
- lab21: while ( ( p >= himemmin ) ) {
-
- f = mem [ p ] .hh.b0 ;
- i = fontinfo [ charbase [ f ] + mem [ p ] .hh.b1 ] .qqqq ;
- hd = i .b1 ;
- x = x + fontinfo [ widthbase [ f ] + i .b0 ] .cint ;
- s = fontinfo [ heightbase [ f ] + ( hd ) / 16 ] .cint ;
- if ( s > h )
- h = s ;
- s = fontinfo [ depthbase [ f ] + ( hd ) % 16 ] .cint ;
- if ( s > d )
- d = s ;
- p = mem [ p ] .hh .v.RH ;
- }
- if ( p != 0 )
- {
- switch ( mem [ p ] .hh.b0 )
- {case 0 :
- case 1 :
- case 2 :
- case 13 :
- {
- x = x + mem [ p + 1 ] .cint ;
- if ( mem [ p ] .hh.b0 >= 2 )
- s = 0 ;
- else s = mem [ p + 4 ] .cint ;
- if ( mem [ p + 3 ] .cint - s > h )
- h = mem [ p + 3 ] .cint - s ;
- if ( mem [ p + 2 ] .cint + s > d )
- d = mem [ p + 2 ] .cint + s ;
- }
- break ;
- case 3 :
- case 4 :
- case 5 :
- if ( adjusttail != 0 )
- {
- while ( mem [ q ] .hh .v.RH != p ) q = mem [ q ] .hh .v.RH ;
- if ( mem [ p ] .hh.b0 == 5 )
- {
- mem [ adjusttail ] .hh .v.RH = mem [ p + 1 ] .cint ;
- while ( mem [ adjusttail ] .hh .v.RH != 0 ) adjusttail = mem [
- adjusttail ] .hh .v.RH ;
- p = mem [ p ] .hh .v.RH ;
- freenode ( mem [ q ] .hh .v.RH , 2 ) ;
- }
- else {
-
- mem [ adjusttail ] .hh .v.RH = p ;
- adjusttail = p ;
- p = mem [ p ] .hh .v.RH ;
- }
- mem [ q ] .hh .v.RH = p ;
- p = q ;
- }
- break ;
- case 8 :
- ;
- break ;
- case 10 :
- {
- g = mem [ p + 1 ] .hh .v.LH ;
- x = x + mem [ g + 1 ] .cint ;
- o = mem [ g ] .hh.b0 ;
- totalstretch [ o ] = totalstretch [ o ] + mem [ g + 2 ] .cint ;
- o = mem [ g ] .hh.b1 ;
- totalshrink [ o ] = totalshrink [ o ] + mem [ g + 3 ] .cint ;
- if ( mem [ p ] .hh.b1 >= 100 )
- {
- g = mem [ p + 1 ] .hh .v.RH ;
- if ( mem [ g + 3 ] .cint > h )
- h = mem [ g + 3 ] .cint ;
- if ( mem [ g + 2 ] .cint > d )
- d = mem [ g + 2 ] .cint ;
- }
- }
- break ;
- case 11 :
- case 9 :
- x = x + mem [ p + 1 ] .cint ;
- break ;
- case 6 :
- {
- mem [ memtop - 12 ] = mem [ p + 1 ] ;
- mem [ memtop - 12 ] .hh .v.RH = mem [ p ] .hh .v.RH ;
- p = memtop - 12 ;
- goto lab21 ;
- }
- break ;
- default:
- ;
- break ;
- }
- p = mem [ p ] .hh .v.RH ;
- }
- }
- if ( adjusttail != 0 )
- mem [ adjusttail ] .hh .v.RH = 0 ;
- mem [ r + 3 ] .cint = h ;
- mem [ r + 2 ] .cint = d ;
- if ( m == 1 )
- w = x + w ;
- mem [ r + 1 ] .cint = w ;
- x = w - x ;
- if ( x == 0 )
- {
- mem [ r + 5 ] .hh.b0 = 0 ;
- mem [ r + 5 ] .hh.b1 = 0 ;
- mem [ r + 6 ] .gr = 0.0 ;
- goto lab10 ;
- }
- else if ( x > 0 )
- {
- if ( totalstretch [ 3 ] != 0 )
- o = 3 ;
- else if ( totalstretch [ 2 ] != 0 )
- o = 2 ;
- else if ( totalstretch [ 1 ] != 0 )
- o = 1 ;
- else o = 0 ;
- mem [ r + 5 ] .hh.b1 = o ;
- mem [ r + 5 ] .hh.b0 = 1 ;
- if ( totalstretch [ o ] != 0 )
- mem [ r + 6 ] .gr = x / ((double) totalstretch [ o ] ) ;
- else {
-
- mem [ r + 5 ] .hh.b0 = 0 ;
- mem [ r + 6 ] .gr = 0.0 ;
- }
- if ( o == 0 )
- if ( mem [ r + 5 ] .hh .v.RH != 0 )
- {
- lastbadness = badness ( x , totalstretch [ 0 ] ) ;
- if ( lastbadness > eqtb [ 6189 ] .cint )
- {
- println () ;
- if ( lastbadness > 100 )
- printnl ( 837 ) ;
- else printnl ( 838 ) ;
- print ( 839 ) ;
- printint ( lastbadness ) ;
- goto lab50 ;
- }
- }
- goto lab10 ;
- }
- else {
-
- if ( totalshrink [ 3 ] != 0 )
- o = 3 ;
- else if ( totalshrink [ 2 ] != 0 )
- o = 2 ;
- else if ( totalshrink [ 1 ] != 0 )
- o = 1 ;
- else o = 0 ;
- mem [ r + 5 ] .hh.b1 = o ;
- mem [ r + 5 ] .hh.b0 = 2 ;
- if ( totalshrink [ o ] != 0 )
- mem [ r + 6 ] .gr = ( - (integer) x ) / ((double) totalshrink [ o ] ) ;
- else {
-
- mem [ r + 5 ] .hh.b0 = 0 ;
- mem [ r + 6 ] .gr = 0.0 ;
- }
- if ( ( totalshrink [ o ] < - (integer) x ) && ( o == 0 ) && ( mem [ r + 5
- ] .hh .v.RH != 0 ) )
- {
- lastbadness = 1000000L ;
- mem [ r + 6 ] .gr = 1.0 ;
- if ( ( - (integer) x - totalshrink [ 0 ] > eqtb [ 6738 ] .cint ) || (
- eqtb [ 6189 ] .cint < 100 ) )
- {
- if ( ( eqtb [ 6746 ] .cint > 0 ) && ( - (integer) x - totalshrink [ 0
- ] > eqtb [ 6738 ] .cint ) )
- {
- while ( mem [ q ] .hh .v.RH != 0 ) q = mem [ q ] .hh .v.RH ;
- mem [ q ] .hh .v.RH = newrule () ;
- mem [ mem [ q ] .hh .v.RH + 1 ] .cint = eqtb [ 6746 ] .cint ;
- }
- println () ;
- printnl ( 845 ) ;
- printscaled ( - (integer) x - totalshrink [ 0 ] ) ;
- print ( 846 ) ;
- goto lab50 ;
- }
- }
- else if ( o == 0 )
- if ( mem [ r + 5 ] .hh .v.RH != 0 )
- {
- lastbadness = badness ( - (integer) x , totalshrink [ 0 ] ) ;
- if ( lastbadness > eqtb [ 6189 ] .cint )
- {
- println () ;
- printnl ( 847 ) ;
- printint ( lastbadness ) ;
- goto lab50 ;
- }
- }
- goto lab10 ;
- }
- lab50: if ( outputactive )
- print ( 840 ) ;
- else {
-
- if ( packbeginline != 0 )
- {
- if ( packbeginline > 0 )
- print ( 841 ) ;
- else print ( 842 ) ;
- printint ( abs ( packbeginline ) ) ;
- print ( 843 ) ;
- }
- else print ( 844 ) ;
- printint ( line ) ;
- }
- println () ;
- fontinshortdisplay = 0 ;
- shortdisplay ( mem [ r + 5 ] .hh .v.RH ) ;
- println () ;
- begindiagnostic () ;
- showbox ( r ) ;
- enddiagnostic ( true ) ;
- lab10: Result = r ;
- return(Result) ;
- }
- halfword zvpackage ( p , h , m , l )
- halfword p ;
- scaled h ;
- smallnumber m ;
- scaled l ;
- {/* 50 10 */ register halfword Result; vpackage_regmem
- halfword r ;
- scaled w, d, x ;
- scaled s ;
- halfword g ;
- glueord o ;
- lastbadness = 0 ;
- r = getnode ( 7 ) ;
- mem [ r ] .hh.b0 = 1 ;
- mem [ r ] .hh.b1 = 0 ;
- mem [ r + 4 ] .cint = 0 ;
- mem [ r + 5 ] .hh .v.RH = p ;
- w = 0 ;
- d = 0 ;
- x = 0 ;
- totalstretch [ 0 ] = 0 ;
- totalshrink [ 0 ] = 0 ;
- totalstretch [ 1 ] = 0 ;
- totalshrink [ 1 ] = 0 ;
- totalstretch [ 2 ] = 0 ;
- totalshrink [ 2 ] = 0 ;
- totalstretch [ 3 ] = 0 ;
- totalshrink [ 3 ] = 0 ;
- while ( p != 0 ) {
-
- if ( ( p >= himemmin ) )
- confusion ( 848 ) ;
- else switch ( mem [ p ] .hh.b0 )
- {case 0 :
- case 1 :
- case 2 :
- case 13 :
- {
- x = x + d + mem [ p + 3 ] .cint ;
- d = mem [ p + 2 ] .cint ;
- if ( mem [ p ] .hh.b0 >= 2 )
- s = 0 ;
- else s = mem [ p + 4 ] .cint ;
- if ( mem [ p + 1 ] .cint + s > w )
- w = mem [ p + 1 ] .cint + s ;
- }
- break ;
- case 8 :
- ;
- break ;
- case 10 :
- {
- x = x + d ;
- d = 0 ;
- g = mem [ p + 1 ] .hh .v.LH ;
- x = x + mem [ g + 1 ] .cint ;
- o = mem [ g ] .hh.b0 ;
- totalstretch [ o ] = totalstretch [ o ] + mem [ g + 2 ] .cint ;
- o = mem [ g ] .hh.b1 ;
- totalshrink [ o ] = totalshrink [ o ] + mem [ g + 3 ] .cint ;
- if ( mem [ p ] .hh.b1 >= 100 )
- {
- g = mem [ p + 1 ] .hh .v.RH ;
- if ( mem [ g + 1 ] .cint > w )
- w = mem [ g + 1 ] .cint ;
- }
- }
- break ;
- case 11 :
- {
- x = x + d + mem [ p + 1 ] .cint ;
- d = 0 ;
- }
- break ;
- default:
- ;
- break ;
- }
- p = mem [ p ] .hh .v.RH ;
- }
- mem [ r + 1 ] .cint = w ;
- if ( d > l )
- {
- x = x + d - l ;
- mem [ r + 2 ] .cint = l ;
- }
- else mem [ r + 2 ] .cint = d ;
- if ( m == 1 )
- h = x + h ;
- mem [ r + 3 ] .cint = h ;
- x = h - x ;
- if ( x == 0 )
- {
- mem [ r + 5 ] .hh.b0 = 0 ;
- mem [ r + 5 ] .hh.b1 = 0 ;
- mem [ r + 6 ] .gr = 0.0 ;
- goto lab10 ;
- }
- else if ( x > 0 )
- {
- if ( totalstretch [ 3 ] != 0 )
- o = 3 ;
- else if ( totalstretch [ 2 ] != 0 )
- o = 2 ;
- else if ( totalstretch [ 1 ] != 0 )
- o = 1 ;
- else o = 0 ;
- mem [ r + 5 ] .hh.b1 = o ;
- mem [ r + 5 ] .hh.b0 = 1 ;
- if ( totalstretch [ o ] != 0 )
- mem [ r + 6 ] .gr = x / ((double) totalstretch [ o ] ) ;
- else {
-
- mem [ r + 5 ] .hh.b0 = 0 ;
- mem [ r + 6 ] .gr = 0.0 ;
- }
- if ( o == 0 )
- if ( mem [ r + 5 ] .hh .v.RH != 0 )
- {
- lastbadness = badness ( x , totalstretch [ 0 ] ) ;
- if ( lastbadness > eqtb [ 6190 ] .cint )
- {
- println () ;
- if ( lastbadness > 100 )
- printnl ( 837 ) ;
- else printnl ( 838 ) ;
- print ( 849 ) ;
- printint ( lastbadness ) ;
- goto lab50 ;
- }
- }
- goto lab10 ;
- }
- else {
-
- if ( totalshrink [ 3 ] != 0 )
- o = 3 ;
- else if ( totalshrink [ 2 ] != 0 )
- o = 2 ;
- else if ( totalshrink [ 1 ] != 0 )
- o = 1 ;
- else o = 0 ;
- mem [ r + 5 ] .hh.b1 = o ;
- mem [ r + 5 ] .hh.b0 = 2 ;
- if ( totalshrink [ o ] != 0 )
- mem [ r + 6 ] .gr = ( - (integer) x ) / ((double) totalshrink [ o ] ) ;
- else {
-
- mem [ r + 5 ] .hh.b0 = 0 ;
- mem [ r + 6 ] .gr = 0.0 ;
- }
- if ( ( totalshrink [ o ] < - (integer) x ) && ( o == 0 ) && ( mem [ r + 5
- ] .hh .v.RH != 0 ) )
- {
- lastbadness = 1000000L ;
- mem [ r + 6 ] .gr = 1.0 ;
- if ( ( - (integer) x - totalshrink [ 0 ] > eqtb [ 6739 ] .cint ) || (
- eqtb [ 6190 ] .cint < 100 ) )
- {
- println () ;
- printnl ( 850 ) ;
- printscaled ( - (integer) x - totalshrink [ 0 ] ) ;
- print ( 851 ) ;
- goto lab50 ;
- }
- }
- else if ( o == 0 )
- if ( mem [ r + 5 ] .hh .v.RH != 0 )
- {
- lastbadness = badness ( - (integer) x , totalshrink [ 0 ] ) ;
- if ( lastbadness > eqtb [ 6190 ] .cint )
- {
- println () ;
- printnl ( 852 ) ;
- printint ( lastbadness ) ;
- goto lab50 ;
- }
- }
- goto lab10 ;
- }
- lab50: if ( outputactive )
- print ( 840 ) ;
- else {
-
- if ( packbeginline != 0 )
- {
- print ( 842 ) ;
- printint ( abs ( packbeginline ) ) ;
- print ( 843 ) ;
- }
- else print ( 844 ) ;
- printint ( line ) ;
- println () ;
- }
- begindiagnostic () ;
- showbox ( r ) ;
- enddiagnostic ( true ) ;
- lab10: Result = r ;
- return(Result) ;
- }
- void zappendtovlist ( b )
- halfword b ;
- {appendtovlist_regmem
- scaled d ;
- halfword p ;
- if ( curlist .auxfield .cint > -65536000L )
- {
- d = mem [ eqtb [ 3783 ] .hh .v.RH + 1 ] .cint - curlist .auxfield .cint -
- mem [ b + 3 ] .cint ;
- if ( d < eqtb [ 6732 ] .cint )
- p = newparamglue ( 0 ) ;
- else {
-
- p = newskipparam ( 1 ) ;
- mem [ tempptr + 1 ] .cint = d ;
- }
- mem [ curlist .tailfield ] .hh .v.RH = p ;
- curlist .tailfield = p ;
- }
- mem [ curlist .tailfield ] .hh .v.RH = b ;
- curlist .tailfield = b ;
- curlist .auxfield .cint = mem [ b + 2 ] .cint ;
- }
- halfword newnoad ( )
- {register halfword Result; newnoad_regmem
- halfword p ;
- p = getnode ( 4 ) ;
- mem [ p ] .hh.b0 = 16 ;
- mem [ p ] .hh.b1 = 0 ;
- mem [ p + 1 ] .hh = emptyfield ;
- mem [ p + 3 ] .hh = emptyfield ;
- mem [ p + 2 ] .hh = emptyfield ;
- Result = p ;
- return(Result) ;
- }
- halfword znewstyle ( s )
- smallnumber s ;
- {register halfword Result; newstyle_regmem
- halfword p ;
- p = getnode ( 3 ) ;
- mem [ p ] .hh.b0 = 14 ;
- mem [ p ] .hh.b1 = s ;
- mem [ p + 1 ] .cint = 0 ;
- mem [ p + 2 ] .cint = 0 ;
- Result = p ;
- return(Result) ;
- }
- halfword newchoice ( )
- {register halfword Result; newchoice_regmem
- halfword p ;
- p = getnode ( 3 ) ;
- mem [ p ] .hh.b0 = 15 ;
- mem [ p ] .hh.b1 = 0 ;
- mem [ p + 1 ] .hh .v.LH = 0 ;
- mem [ p + 1 ] .hh .v.RH = 0 ;
- mem [ p + 2 ] .hh .v.LH = 0 ;
- mem [ p + 2 ] .hh .v.RH = 0 ;
- Result = p ;
- return(Result) ;
- }
- void showinfo ( )
- {showinfo_regmem
- shownodelist ( mem [ tempptr ] .hh .v.LH ) ;
- }
- halfword zfractionrule ( t )
- scaled t ;
- {register halfword Result; fractionrule_regmem
- halfword p ;
- p = newrule () ;
- mem [ p + 3 ] .cint = t ;
- mem [ p + 2 ] .cint = 0 ;
- Result = p ;
- return(Result) ;
- }
- halfword zoverbar ( b , k , t )
- halfword b ;
- scaled k ;
- scaled t ;
- {register halfword Result; overbar_regmem
- halfword p, q ;
- p = newkern ( k ) ;
- mem [ p ] .hh .v.RH = b ;
- q = fractionrule ( t ) ;
- mem [ q ] .hh .v.RH = p ;
- p = newkern ( t ) ;
- mem [ p ] .hh .v.RH = q ;
- Result = vpackage ( p , 0 , 1 , 1073741823L ) ;
- return(Result) ;
- }
- halfword zcharbox ( f , c )
- internalfontnumber f ;
- quarterword c ;
- {register halfword Result; charbox_regmem
- fourquarters q ;
- eightbits hd ;
- halfword b, p ;
- q = fontinfo [ charbase [ f ] + c ] .qqqq ;
- hd = q .b1 ;
- b = newnullbox () ;
- mem [ b + 1 ] .cint = fontinfo [ widthbase [ f ] + q .b0 ] .cint + fontinfo
- [ italicbase [ f ] + ( q .b2 ) / 4 ] .cint ;
- mem [ b + 3 ] .cint = fontinfo [ heightbase [ f ] + ( hd ) / 16 ] .cint ;
- mem [ b + 2 ] .cint = fontinfo [ depthbase [ f ] + ( hd ) % 16 ] .cint ;
- p = getavail () ;
- mem [ p ] .hh.b1 = c ;
- mem [ p ] .hh.b0 = f ;
- mem [ b + 5 ] .hh .v.RH = p ;
- Result = b ;
- return(Result) ;
- }
- void zstackintobox ( b , f , c )
- halfword b ;
- internalfontnumber f ;
- quarterword c ;
- {stackintobox_regmem
- halfword p ;
- p = charbox ( f , c ) ;
- mem [ p ] .hh .v.RH = mem [ b + 5 ] .hh .v.RH ;
- mem [ b + 5 ] .hh .v.RH = p ;
- mem [ b + 3 ] .cint = mem [ p + 3 ] .cint ;
- }
- scaled zheightplusdepth ( f , c )
- internalfontnumber f ;
- quarterword c ;
- {register scaled Result; heightplusdepth_regmem
- fourquarters q ;
- eightbits hd ;
- q = fontinfo [ charbase [ f ] + c ] .qqqq ;
- hd = q .b1 ;
- Result = fontinfo [ heightbase [ f ] + ( hd ) / 16 ] .cint + fontinfo [
- depthbase [ f ] + ( hd ) % 16 ] .cint ;
- return(Result) ;
- }
- halfword zvardelimiter ( d , s , v )
- halfword d ;
- smallnumber s ;
- scaled v ;
- {/* 40 22 */ register halfword Result; vardelimiter_regmem
- halfword b ;
- internalfontnumber f, g ;
- quarterword c, x, y ;
- integer m, n ;
- scaled u ;
- scaled w ;
- fourquarters q ;
- eightbits hd ;
- fourquarters r ;
- smallnumber z ;
- boolean largeattempt ;
- f = 0 ;
- w = 0 ;
- largeattempt = false ;
- z = mem [ d ] .qqqq .b0 ;
- x = mem [ d ] .qqqq .b1 ;
- while ( true ) {
-
- if ( ( z != 0 ) || ( x != 0 ) )
- {
- z = z + s + 16 ;
- do {
- z = z - 16 ;
- g = eqtb [ 4835 + z ] .hh .v.RH ;
- if ( g != 0 )
- {
- y = x ;
- if ( ( y >= fontbc [ g ] ) && ( y <= fontec [ g ] ) )
- {
- lab22: q = fontinfo [ charbase [ g ] + y ] .qqqq ;
- if ( ( q .b0 > 0 ) )
- {
- if ( ( ( q .b2 ) % 4 ) == 3 )
- {
- f = g ;
- c = y ;
- goto lab40 ;
- }
- hd = q .b1 ;
- u = fontinfo [ heightbase [ g ] + ( hd ) / 16 ] .cint + fontinfo
- [ depthbase [ g ] + ( hd ) % 16 ] .cint ;
- if ( u > w )
- {
- f = g ;
- c = y ;
- w = u ;
- if ( u >= v )
- goto lab40 ;
- }
- if ( ( ( q .b2 ) % 4 ) == 2 )
- {
- y = q .b3 ;
- goto lab22 ;
- }
- }
- }
- }
- } while ( ! ( z < 16 ) ) ;
- }
- if ( largeattempt )
- goto lab40 ;
- largeattempt = true ;
- z = mem [ d ] .qqqq .b2 ;
- x = mem [ d ] .qqqq .b3 ;
- }
- lab40: if ( f != 0 )
- if ( ( ( q .b2 ) % 4 ) == 3 )
- {
- b = newnullbox () ;
- mem [ b ] .hh.b0 = 1 ;
- r = fontinfo [ extenbase [ f ] + q .b3 ] .qqqq ;
- c = r .b3 ;
- u = heightplusdepth ( f , c ) ;
- w = 0 ;
- q = fontinfo [ charbase [ f ] + c ] .qqqq ;
- mem [ b + 1 ] .cint = fontinfo [ widthbase [ f ] + q .b0 ] .cint +
- fontinfo [ italicbase [ f ] + ( q .b2 ) / 4 ] .cint ;
- c = r .b2 ;
- if ( c != 0 )
- w = w + heightplusdepth ( f , c ) ;
- c = r .b1 ;
- if ( c != 0 )
- w = w + heightplusdepth ( f , c ) ;
- c = r .b0 ;
- if ( c != 0 )
- w = w + heightplusdepth ( f , c ) ;
- n = 0 ;
- if ( u > 0 )
- while ( w < v ) {
-
- w = w + u ;
- incr ( n ) ;
- if ( r .b1 != 0 )
- w = w + u ;
- }
- c = r .b2 ;
- if ( c != 0 )
- stackintobox ( b , f , c ) ;
- c = r .b3 ;
- {register integer for_end; m = 1 ; for_end = n ; if ( m <= for_end) do
- stackintobox ( b , f , c ) ;
- while ( m++ < for_end ) ; }
- c = r .b1 ;
- if ( c != 0 )
- {
- stackintobox ( b , f , c ) ;
- c = r .b3 ;
- {register integer for_end; m = 1 ; for_end = n ; if ( m <= for_end) do
- stackintobox ( b , f , c ) ;
- while ( m++ < for_end ) ; }
- }
- c = r .b0 ;
- if ( c != 0 )
- stackintobox ( b , f , c ) ;
- mem [ b + 2 ] .cint = w - mem [ b + 3 ] .cint ;
- }
- else b = charbox ( f , c ) ;
- else {
-
- b = newnullbox () ;
- mem [ b + 1 ] .cint = eqtb [ 6741 ] .cint ;
- }
- mem [ b + 4 ] .cint = half ( mem [ b + 3 ] .cint - mem [ b + 2 ] .cint ) -
- fontinfo [ 22 + parambase [ eqtb [ 4837 + s ] .hh .v.RH ] ] .cint ;
- Result = b ;
- return(Result) ;
- }
- halfword zrebox ( b , w )
- halfword b ;
- scaled w ;
- {register halfword Result; rebox_regmem
- halfword p ;
- internalfontnumber f ;
- scaled v ;
- if ( ( mem [ b + 1 ] .cint != w ) && ( mem [ b + 5 ] .hh .v.RH != 0 ) )
- {
- if ( mem [ b ] .hh.b0 == 1 )
- b = hpack ( b , 0 , 1 ) ;
- p = mem [ b + 5 ] .hh .v.RH ;
- if ( ( ( p >= himemmin ) ) && ( mem [ p ] .hh .v.RH == 0 ) )
- {
- f = mem [ p ] .hh.b0 ;
- v = fontinfo [ widthbase [ f ] + fontinfo [ charbase [ f ] + mem [ p ]
- .hh.b1 ] .qqqq .b0 ] .cint ;
- if ( v != mem [ b + 1 ] .cint )
- mem [ p ] .hh .v.RH = newkern ( mem [ b + 1 ] .cint - v ) ;
- }
- freenode ( b , 7 ) ;
- b = newglue ( 12 ) ;
- mem [ b ] .hh .v.RH = p ;
- while ( mem [ p ] .hh .v.RH != 0 ) p = mem [ p ] .hh .v.RH ;
- mem [ p ] .hh .v.RH = newglue ( 12 ) ;
- Result = hpack ( b , w , 0 ) ;
- }
- else {
-
- mem [ b + 1 ] .cint = w ;
- Result = b ;
- }
- return(Result) ;
- }
- halfword zmathglue ( g , m )
- halfword g ;
- scaled m ;
- {register halfword Result; mathglue_regmem
- halfword p ;
- integer n ;
- scaled f ;
- n = xovern ( m , 65536L ) ;
- f = remainder ;
- p = getnode ( 4 ) ;
- mem [ p + 1 ] .cint = multandadd ( n , mem [ g + 1 ] .cint , xnoverd ( mem [
- g + 1 ] .cint , f , 65536L ) , 1073741823L ) ;
- mem [ p ] .hh.b0 = mem [ g ] .hh.b0 ;
- if ( mem [ p ] .hh.b0 == 0 )
- mem [ p + 2 ] .cint = multandadd ( n , mem [ g + 2 ] .cint , xnoverd ( mem [
- g + 2 ] .cint , f , 65536L ) , 1073741823L ) ;
- else mem [ p + 2 ] .cint = mem [ g + 2 ] .cint ;
- mem [ p ] .hh.b1 = mem [ g ] .hh.b1 ;
- if ( mem [ p ] .hh.b1 == 0 )
- mem [ p + 3 ] .cint = multandadd ( n , mem [ g + 3 ] .cint , xnoverd ( mem [
- g + 3 ] .cint , f , 65536L ) , 1073741823L ) ;
- else mem [ p + 3 ] .cint = mem [ g + 3 ] .cint ;
- Result = p ;
- return(Result) ;
- }
- void zmathkern ( p , m )
- halfword p ;
- scaled m ;
- {mathkern_regmem
- integer n ;
- scaled f ;
- if ( mem [ p ] .hh.b1 == 99 )
- {
- n = xovern ( m , 65536L ) ;
- f = remainder ;
- mem [ p + 1 ] .cint = multandadd ( n , mem [ p + 1 ] .cint , xnoverd ( mem
- [ p + 1 ] .cint , f , 65536L ) , 1073741823L ) ;
- mem [ p ] .hh.b1 = 0 ;
- }
- }
-